import React, { Component } from 'react'
import Child1 from './Child1'
import { CounterContext } from './Context'

// #2 祖先通过 CounterContext.Provider 配合 value 提供数据
export default class App extends Component {
  state = {
    count: 8,
  }
  render() {
    return (
      <CounterContext.Provider value={this.state.count}>
        <div>
          App
          <hr />
          <Child1 />
        </div>
      </CounterContext.Provider>
    )
  }
}
